Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
How to Create a line break in WhatsApp messages [ReactJS Web]

I'm trying to send a message from ReactJs to Whatsapp api But i can't create a content text with line break : ex:

Hello Shop,
I'm looking for this Shoes. Can you help me ?
--Name

This is my code that i tried with :

   <button onClick={
     () => window.open("https://wa.me/phoneNumber?text="Hello Shop,'\n'
      I'm looking for this Shoes. Can you help me ? '\n'
     --<Name>")}>
       Send Message
   <Button>

I tried with : '\n', '\r\n\r\n', '%0a', '%0D%0A',... But did not work.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

linebreaks are "normaly" encoded by \n (LF), \r\n (CRLF).

for whatsapp you also need to urlencode the message

line1="hello"
line2="world"
msg = encodeURIComponent(`${line1}\r\n${line2}`)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!